package com.neutech.demo.day03;

import java.util.Arrays;

public class Demo02 {
    public static void main(String[] args) {
//        int[] array1 = new int[]{1,2,3,4,5,6};
//        array1 =  Arrays.copyOf(array1,array1.length+1);
//        array1[array1.length-1] = 100;
//        System.out.println(Arrays.toString(array1));
//        System.out.println(array1[array1.length-1]);

        int[] array1 = new int[]{1, 2, 3, 4, 5, 6};
        int[] array2 = new int[10];
        System.arraycopy(array1, 0, array2, 0, array1.length);
        System.out.println(Arrays.toString(array1));
        System.out.println(Arrays.toString(array2));
    }
}
